\name{mrw.sim}

\alias{mrw.sim}
\alias{mrw.plot}

\alias{mrwAll.sim}
\alias{mrwAll.plot}

\alias{mAR.sim}
\alias{mAR.plot}

\alias{mar.sim}
\alias{mar.plot}

\alias{mrwd.sim}
\alias{mrwd.plot}

\alias{mrwrd.sim}
\alias{mrwrd.plot}

\alias{yrw.sim}
\alias{yrw.plot}

\alias{yrwd.sim}
\alias{yrwd.plot}


%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Functions for simulating time series random processes   
}
\description{
A set of function to simulate different random processes: The \code{.sim} functions simulated a single process while 
The \code{.plot} functions use \code{matplot} to plot multiple processes.  
  
}
\usage{
mrw.sim(N = 100, mu = 0, sige = 10, sigb = 1, plot = FALSE)
mrw.plot(N = 100, k = 5, ...)

mrwAll.sim(N, mu0 = 0, sige = 1, sigb = 1, order = 1, 
           plot = FALSE)
mrwAll.plot(N = 100, k = 5, ...)

mAR.sim(N, mu0 = 0, sige = 1, sigb = 1, phi = c(0.5), 
         plot = FALSE)
mAR.plot(N = 1000, k = 5, ...)

mar.sim(N, mu0 = 0, sige = 1, sigb = 1, phi = c(0.5), 
         plot = FALSE)
mar.plot(N = 1000, k = 5, ...)

mrwd.sim(N = 1000, mu = 100, d = 0.1, sige = 10, sigb = 1, 
        
plot = FALSE)
mrwd.plot(N = 100, k = 5, ...)

mrwrd.sim(N = 100, mu = 0, d = 0.5, sige = 10, sigb = 1, sigd = 1, plot = FALSE)
mrwrd.plot(N = 100, k = 5, ...)

yrw.sim(N = 1000, mu = 0, sigma = 1, plot = FALSE)
yrw.plot(N = 100, k = 10, ...)

yrwd.sim(N = 1000, mu = 0, d = 0.1, sigma = 1,
         plot = FALSE)
yrwd.plot(N = 100, k = 5, ...)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{N}{
The length  of the random process
          }
  \item{mu}{
The initial value for the mean of the process
          }
 \item{mu0}{
The initial value for the mean of the process
          }
  \item{sige}{
The standard deviation of the y variable.
}
  \item{sigb}{
The standard deviation of the mu process.
             }
  \item{sigd}{
The standard deviation of the drift.
             }
 \item{sigma}{
The standard deviation of the y variable.
             }
\item{order}{
the order of the process for mu.
            }
 \item{d}{
starting value for the drift
            }
  \item{plot}{
whether to plot the simulated process
             }
  \item{k}{
The number of simulated process to be plot by the \code{.plot} functions
            }
 \item{phi}{
The autoregressive parameters
            }
\item{\dots}{
For extra arguments
            }
}

\details{
There are several functioned for simulation and plotting:
  SIMULATION functions
\code{mrw.sim} For a mu random walk  process. i.e. \code{y[t]=mu[t]+e[t]}, where \code{m[t]=mu[t-1]+u[t]}, where \code{e[t]~N(0,sige)} and \code{u[t]~N(0,sige)}.
        
\code{cmrwd.sim} Random walk for mu with a drift.

\code{mrwrd.sim} Random walk for mu with a random drift.

\code{mrwAll.sim} Random walks for mu with possible different orders

\code{mar.sim} mu AR process (stationary)

\code{mAR.sim} mu AR process ((non stationary process are allowed

\code{yrw.sim} Random walk for y, i.e. \code{y[t]+y[t-1]+e[t]}
\code{yrwd.sim} Random walk with a drift for y.
}


\value{%%  ~Describe the value returned
The \code{.sim} functions  create a ts object. 
The \code{.plot} functions create a plot.

}
\references{
Benjamin M. A., Rigby R. A. and Stasinopoulos D.M. (2003) Generalised Autoregressive Moving  Average Models.  \emph{J. Am. Statist. Ass.}, 98, 214-223.

Rigby, R. A. and  Stasinopoulos D. M. (2005). Generalised additive models for location, scale and shape,(with discussion), 
\emph{Appl. Statist.}, \bold{54}, part 3, pp 507-554.

Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R.
Accompanying documentation in the current GAMLSS  help files, (see also  \url{http://www.gamlss.com/}). 

Stasinopoulos D. M. Rigby R.A. (2007) Generalised additive models for location scale and shape (GAMLSS) in R.
\emph{Journal of Statistical Software}, Vol. \bold{23}, Issue 7, Dec 2007, \url{http://www.jstatsoft.org/v23/i07}.

}
\author{
Mikis Stasinopoulos \email{d.stasinopoulos@londonmet.ac.uk}, Bob Rigby \email{r.rigby@londonmet.ac.uk},  Vlasios Voudouris  
}


%% ~Make other sections like Warning with \section{Warning }{....} ~


\examples{
mrw.sim(N=1000, plot=TRUE)
mrwd.plot(k=100)
yrwd.plot(k=100)
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ ~kwd1 }
\keyword{regression}
